#include "Game.h"
#include "XMLParser.h"



using namespace std;


/**
 * Prints out information about all the Leveling information in the Game
 * @param void
 * @return void
 */
void Game::showLevelingInformation()
{
	if (m_vecMaxXPperLevel.size() == 0)
	{
		cout << "No leveling information available." << endl;
	}
	else
	{
		cout << "==================" << endl;
		for (unsigned int i = 0; i < m_vecMaxXPperLevel.size(); ++i)
		{
			cout << "Level "<< i + 2 << " - " <<  m_vecMaxXPperLevel[i] << endl;
		}
		cout << "==================" << endl;
	}
}


/**
 * Load information about all the Leveling information in the Game
 * @param void
 * @return void
 */
void Game::loadLevelingInformation()
{
	XMLParser appConfig(GAME_LOADCONFIG_LEVELING_ROOTELEM, GAME_LOADCONFIG_LEVELING_FIRSTELEM);

	appConfig.addATTROption(GAME_LOADCONFIG_LEVELING_ATTR1);
	appConfig.readLevelingConfigFile(GAME_LOADCONFIG_LEVELING_FILENAME, m_vecMaxXPperLevel);
}


/**
 * Empty the structure
 * @param void
 * @return void
 */
void Game::freeLevelingInformation()
{
	m_vecMaxXPperLevel.resize(0);
}